package com.bluetooth.phone.multi;

import android.view.View;

import com.bluetooth.phone.DockItem;
import com.hsae.bluetooth.phones.R;


public class ItemTypeFactoryImp implements TypeFactory {
    public static final int SUB_ITEM_LAYOUT = R.layout.item_dock;
    public static final int SUB_AIR_ITEM_LAYOUT = R.layout.item_dock_air;


    @Override
    public int type(int typeId) {
        if (typeId == 1){
            return SUB_AIR_ITEM_LAYOUT;
        }
        return SUB_ITEM_LAYOUT;
    }

    @Override
    public int type(Visitable visitable) {
        return 0;
    }

    @Override
    public int type(DockItem dockItem) {
        return 0;
    }


    @Override
    public BaseViewHolder<DockItem> createViewHolder(int type, View itemView) {
        switch (type) {
            case SUB_ITEM_LAYOUT:
                return new SubDockViewHolder(itemView);
            case SUB_AIR_ITEM_LAYOUT:
                return new SubAirViewHolder(itemView);
            default:
                return null;
        }
    }
}